home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcr / pcr4_4.lha / DIST / loading / ILTest1.c < prev    next >
C/C++ Source or Header  |  1989-08-18  |  2KB  |  75 lines

  1. /* begincopyright
  2.   Copyright (c) 1988 Xerox Corporation. All rights reserved.
  3.   Use and copying of this software and preparation of derivative works based
  4.   upon this software are permitted. Any distribution of this software or
  5.   derivative works must comply with all applicable United States export
  6.   control laws. This software is made available AS IS, and Xerox Corporation
  7.   makes no warranty about the software, its performance or its conformity to
  8.   any specification. Any person obtaining a copy of this software is requested
  9.   to send their name and post office or electronic mail address to:
  10.     PCR Coordinator
  11.     Xerox PARC
  12.     3333 Coyote Hill Rd.
  13.     Palo Alto, CA 94304
  14.   endcopyright */
  15.  
  16. /*
  17.  * ILTest1.c
  18.  *
  19.  * IncrementalLoader tests from Unix
  20.  *
  21.  * Demers, July 27, 1989 11:57:56 am PDT
  22.  */
  23.  
  24. #if defined(UNIXDEBUG) || defined(UNIX)
  25.  
  26. #include <stdio.h>
  27.  
  28. #include "xr/IncrementalLoad.h"
  29. #include "xr/IncrementalLoadPrivate.h"
  30. #include "xr/OldDynamicLoad.h"
  31.  
  32. void XR_SetupCommander() {}
  33.  
  34.  
  35.  
  36. void
  37. main(argc, argv)
  38.     int argc;
  39.     char **argv;
  40. {
  41.     int argno;
  42.     Installer_Func f;
  43.     char *fileName;
  44.     char *funcName;
  45.     
  46.  
  47.     printf("Hello, world\n");
  48.     printf("Calling SetupDynamicLoader()\n");
  49.     XR_SetupDynamicLoader();
  50.     printf("Calling init_dyload(%s)\n", argv[0]);
  51.     init_dyload(argv[0], FALSE, FALSE);
  52.     printf("Done with init_dyload\n");
  53.     argno = 1;
  54.     while( (argc - argno) >= 2 ) {
  55.         fileName = argv[argno];
  56.         funcName = argv[argno+1];
  57.         argno += 2;
  58.         printf("Loading from %s ...\n", fileName);
  59.         f = load_file(fileName, funcName);
  60.         if( f == NIL ) {
  61.             printf("Load failed\n");
  62.             continue;
  63.         }
  64.         printf("Calling %s ...\n", funcName);
  65.         (void)( (*f)() );
  66.         printf("... done with %s\n", funcName);
  67.     }
  68.     abort();
  69. }
  70.  
  71.  
  72. #else
  73. --> fix makefile.config and remake! <--
  74. #endif
  75.